<?php
/**
 * Created by PhpStorm.
 * User: fuguang
 * Date: 2018/3/20
 * Time: 下午11:06
 */
?>

<div class="tag"><?= $tag->name;?></div>
<div class="wraper" id="tag">
    <!-- foreach -->
    <?= $this->render('/site/tagitem', ['news' => $news,'userinfo' => $userinfo,'lastid' => $lastid]);?>
    <!-- foreach -->
</div>
<div id="lastid" style="display: none;"><?= $lastid;?></div>
<div id="tagid" style="display: none;"><?= $tagid;?></div>
<script src='/js/lvdong/detail.js'></script>
<script type="text/javascript">
    /*列表点赞
    $(function () {
        $(".tagpage").each(function () {
            var newsid = $(this).data("newsid");
            var key = "tagpage-"+newsid;

            if(localStorage[key]){
                $(this).addClass('have');
            };
        });

        $(".tagpage").click(function(){
            var _this = $(this);
            if(!_this.hasClass('have')){
                //发送请求
                var newsid = $(this).data("newsid");
                var key = "tagpage-"+newsid;
                $.get("/nomup-"+newsid+".html", function(result){
                    if( result.ret ){
                        console.log('成功');

                        _this.addClass('have');
                        localStorage[key]="1";
                        var num = _this.text();
                        _this.text(num*1+1);
                    }
                });

            }
        });
    });
    */
</script>
